//
//  YLOrderDetailViewController.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/7.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLOrderDetailViewController.h"
#import "YLGlobeHeader.h"
#import "KLTNavigationController.h"
#import "YLMyAdressModel.h"

@interface YLOrderDetailViewController ()

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
// 收货人
@property (weak, nonatomic) IBOutlet UILabel *receiverLabel;
// 号码
@property (weak, nonatomic) IBOutlet UILabel *phoneNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *codeLabel;

@end

@implementation YLOrderDetailViewController

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    _receiverLabel.text = [NSString stringWithFormat:@"收货人:%@", _addressModel.receiveName];
    _addressLabel.text = [NSString stringWithFormat:@"收货地址:%@ %@ %@ %@", _addressModel.province, _addressModel.city, _addressModel.area, _addressModel.receiveAddress];
    _codeLabel.text = [NSString stringWithFormat:@"兑换编号%@", _orderCode];
    _phoneNumberLabel.text = _addressModel.receiveTel;
    
    
    // 禁用返回手势
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
    
    KLTNavigationController *nav = (KLTNavigationController *)self.navigationController;
    nav.panGestureRec.enabled = NO;
}

- (void)back
{
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navBackground"] forBarMetrics:UIBarMetricsDefault];
    // 修改标题颜色
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
    // 修改状态栏颜色
    self.navigationController.navigationBar.barStyle = UIStatusBarStyleLightContent;
    // 开启返回手势
    
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
    
    KLTNavigationController *nav = (KLTNavigationController *)self.navigationController;
    nav.panGestureRec.enabled = NO;
    
    [self.navigationController popToViewController:self.navigationController.childViewControllers[1] animated:YES];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"订单详情";
    _scrollView.alwaysBounceVertical = YES;
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
